* { box-sizing: border-box; }
body { font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; margin: 0; background: #f3f4f6; color: #1f2328; }
/* 顶部黄条 */
header.topbar { background: #f7b500; color: #1f2328; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; }
header.topbar .top-left { display: flex; align-items: center; gap: 10px; }
header.topbar .logo { width: 28px; height: 28px; border-radius: 50%; }
header.topbar .brand-name { font-weight: 700; }
header.topbar .top-right { display: flex; align-items: center; gap: 16px; }
#auth-status { font-weight: 600; }

/* 布局 */
.layout { display: grid; grid-template-columns: 200px 1fr; }
main { padding: 20px; }
.sidebar { background: #1f2328; color: #e5e7eb; min-height: calc(100vh - 60px); padding: 12px; }
.sidebar .nav-item { width: 100%; text-align: left; background: transparent; color: #e5e7eb; border: none; padding: 10px 12px; border-radius: 8px; cursor: pointer; }
.sidebar .nav-item:hover { background: #374151; }
.sidebar .nav-item.active { background: #f7b500; color: #1f2328; font-weight: 700; }
.view { background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; padding: 16px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.hidden { display: none !important; }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.inline-form label { display: flex; align-items: center; gap: 6px; background: #f8fafc; padding: 6px 8px; border-radius: 6px; }
.inline-form input { border: 1px solid #cbd5e1; border-radius: 6px; padding: 4px 6px; }
.inline-form button { padding: 6px 10px; }
.actions { display: flex; gap: 8px; margin: 10px 0; }
.result { background: #0f172a; color: #e2e8f0; padding: 10px; border-radius: 8px; overflow: auto; max-height: 300px; }

/* 表格样式 */
.table { 
  margin-top: 10px; 
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  border-radius: 8px;
  overflow: hidden;
}
.table table { 
  width: 100%; 
  border-collapse: collapse; 
  table-layout: fixed; 
}
.table th, .table td { 
  border: 1px solid #e2e8f0; 
  padding: 12px 16px; 
  text-align: left; 
  word-wrap: break-word;
  overflow: hidden;
}
.table th {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  font-weight: 600;
  color: #374151;
  min-width: 120px;
  width: auto;
  border-bottom: 2px solid #e2e8f0;
}
.table td {
  background: #ffffff;
  transition: background-color 0.2s ease;
}
.table tr:hover td {
  background: #f8fafc;
}
.table thead { background: #f8fafc; }
.table .actions-cell button { margin-right: 6px; }

/* Flavors display styles */
.flavors-cell {
    max-width: 300px;
    padding: 8px;
}

.flavors-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.flavor-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 6px;
    background-color: #f8f9fa;
    border-radius: 4px;
    border-left: 3px solid #007bff;
}

/* Status display styles */
.status-cell {
    text-align: center;
}

.status-enabled {
    color: #16a34a;
    font-weight: 600;
    background: #dcfce7;
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
}

.status-disabled {
    color: #dc2626;
    font-weight: 600;
    background: #fee2e2;
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
}

/* 订单状态样式 */
.order-status-pending-payment {
  color: #f59e0b;
  background-color: #fef3c7;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}

.order-status-to-be-confirmed {
  color: #3b82f6;
  background-color: #dbeafe;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}

.order-status-confirmed {
  color: #8b5cf6;
  background-color: #ede9fe;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}

.order-status-delivery {
  color: #06b6d4;
  background-color: #cffafe;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}

.order-status-completed {
  color: #10b981;
  background-color: #d1fae5;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}

.order-status-cancelled {
  color: #ef4444;
  background-color: #fee2e2;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}

.order-status-unknown {
  color: #6b7280;
  background-color: #f3f4f6;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}

/* 订单状态单元格样式 */
.order-status-cell {
  text-align: center;
  vertical-align: middle;
}

/* Category display styles */
.category-cell {
    text-align: center;
}

.category-name {
    color: #1f2937;
    font-weight: 500;
    background: #f3f4f6;
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
}

.no-category {
    color: #6b7280;
    font-style: italic;
}

.flavor-name {
    font-weight: bold;
    color: #495057;
    font-size: 12px;
}

.flavor-options {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.flavor-option {
    display: inline-block;
    padding: 2px 6px;
    background-color: #e9ecef;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    font-size: 11px;
    color: #6c757d;
    white-space: nowrap;
}

.flavor-option:hover {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
}

.no-flavors {
    color: #6c757d;
    font-style: italic;
    font-size: 12px;
}

/* 弹窗样式 */
.modal {
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
}

.modal-content {
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid #e9ecef;
}

.modal-header h3 {
  margin: 0;
  color: #333;
}

.close {
  font-size: 28px;
  font-weight: bold;
  color: #aaa;
  cursor: pointer;
  line-height: 1;
}

.close:hover {
  color: #000;
}

.modal-body {
  padding: 20px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
  color: #333;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  box-sizing: border-box;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.flavors-config {
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 15px;
  margin-bottom: 10px;
  background: #f8f9fa;
}

.flavor-config-item {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
  align-items: center;
}

.flavor-config-item input {
  flex: 1;
}

.btn-remove-flavor {
  background: #dc3545;
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
}

.btn-remove-flavor:hover {
  background: #c82333;
}

.btn-add-flavor {
  background: #28a745;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
}

.btn-add-flavor:hover {
  background: #218838;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid #e9ecef;
}

.btn-cancel {
  background: #6c757d;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
}

.btn-cancel:hover {
  background: #5a6268;
}

.btn-submit {
  background: #007bff;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
}

.btn-submit:hover {
  background: #0056b3;
}

/* 操作按钮样式 */
.action-cell {
  text-align: center;
}

.btn-modify {
  background: #007bff;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
}

.btn-modify:hover {
  background: #0056b3;
}

/* 图片单元格样式 */
.table .image-cell {
  text-align: center;
  vertical-align: middle;
  padding: 8px;
}

.table .table-image {
  max-width: 80px;
  max-height: 60px;
  width: auto;
  height: auto;
  border-radius: 4px;
  border: 1px solid #e2e8f0;
  object-fit: cover;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.table .table-image:hover {
  transform: scale(1.1);
  border-color: #3b82f6;
}

.table .no-image {
  color: #9ca3af;
  font-size: 12px;
  font-style: italic;
  padding: 4px 8px;
  background-color: #f9fafb;
  border-radius: 4px;
  border: 1px dashed #d1d5db;
}
.total { margin-bottom: 6px; font-weight: 600; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }

/* 工作台数据区域样式 */
.data-section { 
  margin-bottom: 24px; 
  background: #fff; 
  border: 1px solid #e5e7eb; 
  border-radius: 8px; 
  padding: 16px; 
  box-shadow: 0 1px 3px rgba(0,0,0,0.1); 
}
.data-section h3 { 
  margin: 0 0 12px 0; 
  color: #1f2937; 
  font-size: 16px; 
  font-weight: 600; 
  border-bottom: 2px solid #f7b500; 
  padding-bottom: 8px; 
}
.data-section .table { 
  margin-top: 0; 
}
.data-section table { 
  width: 100%; 
  border-collapse: collapse; 
  margin-bottom: 12px; 
}
.data-section th { 
  background: #f8fafc; 
  color: #374151; 
  font-weight: 600; 
  padding: 16px 12px; 
  border: 1px solid #e5e7eb; 
  text-align: center; 
  min-width: 140px;
  width: auto;
}
.data-section td { 
  padding: 14px 12px; 
  border: 1px solid #e5e7eb; 
  text-align: center; 
  word-wrap: break-word;
}
.data-section td.loading { 
  color: #6b7280; 
  font-style: italic; 
  text-align: center; 
}
.refresh-btn { 
  background: #f7b500; 
  color: #1f2328; 
  border: none; 
  padding: 8px 16px; 
  border-radius: 6px; 
  cursor: pointer; 
  font-weight: 600; 
  transition: background-color 0.2s; 
}
.refresh-btn:hover { 
  background: #e6a500; 
}

/* 分页样式 */
.pagination { display: flex; align-items: center; gap: 8px; margin: 10px 0; flex-wrap: wrap; }
.page-btn { border: 1px solid #cbd5e1; background: #fff; color: #1f2328; padding: 8px 12px; border-radius: 6px; cursor: pointer; min-width: 36px; text-align: center; }
.page-btn:hover { background: #eaf2ff; border-color: #93c5fd; }
.page-btn.active { background: #55b044; color: #fff; border-color: #55b044; font-weight: 700; }
.page-jump { display: inline-flex; align-items: center; gap: 6px; margin-left: 8px; }
.page-jump input { width: 60px; padding: 6px 8px; border: 1px solid #cbd5e1; border-radius: 6px; }
.page-jump button { padding: 6px 10px; }

/* 登录分屏样式 */
.login-page { position: fixed; inset: 0; background: #1f2937; display: flex; align-items: center; justify-content: center; z-index: 9999; }
.login-wrap { width: 920px; max-width: 90vw; height: 520px; display: grid; grid-template-columns: 1.2fr 1fr; border-radius: 12px; overflow: hidden; box-shadow: 0 8px 30px rgba(0,0,0,0.25); }
.login-left { background: url('https://images.unsplash.com/photo-1546069901-eacef0df6022?q=80&w=1200&auto=format&fit=crop') center/cover no-repeat; }
.login-right { background: #fff; display: flex; align-items: center; justify-content: center; }
.login-card { width: 80%; max-width: 360px; }
.brand { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.brand img { width: 36px; height: 36px; }
.brand .title { font-size: 18px; font-weight: 700; }
.brand .subtitle { font-size: 12px; color: #6b7280; }
.login-form { display: grid; gap: 12px; }
.login-form .input { display: grid; gap: 6px; }
.login-form input { border: 1px solid #d1d5db; border-radius: 8px; padding: 10px; font-size: 14px; }
.login-btn { background: #f7b500; color: #1f2328; border: none; border-radius: 999px; padding: 10px 16px; font-weight: 700; cursor: pointer; }
.login-btn:hover { filter: brightness(0.98); }
/* 登录消息 */
.login-msg { margin-top: 8px; font-size: 12px; color: #b91c1c; min-height: 1em; }

/* 退出登录按钮 */
.logout-btn {
  background: #ef4444;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
  margin-left: 12px;
  transition: background-color 0.2s;
}
.logout-btn:hover {
  background: #dc2626;
}

/* 报表图表容器 */
.chart {
  width: 100%;
  height: 280px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 8px;
}
.chart canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* 套餐管理样式 */
.setmeal-dishes {
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 12px;
  margin-top: 8px;
  background: #f8fafc;
}

.setmeal-dishes h4 {
  margin: 0 0 12px 0;
  color: #374151;
  font-size: 14px;
  font-weight: 600;
}

.setmeal-dish-item {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
  padding: 8px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
}

.setmeal-dish-item:last-child {
  margin-bottom: 0;
}

.setmeal-dish-item select,
.setmeal-dish-item input {
  flex: 1;
  min-width: 120px;
}

.setmeal-dish-item .dish-select {
  flex: 2;
}

.setmeal-dish-item .copies-input {
  flex: 1;
  max-width: 80px;
}

.btn-remove-dish {
  background: #ef4444;
  color: white;
  border: none;
  padding: 6px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  white-space: nowrap;
}

.btn-remove-dish:hover {
  background: #dc2626;
}

.btn-add-dish {
  background: #10b981;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  margin-top: 8px;
}

.btn-add-dish:hover {
  background: #059669;
}

/* 模态框操作按钮样式 */
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #e5e7eb;
}

.modal-actions button {
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}

.modal-actions .primary {
  background: #f7b500;
  color: #1f2328;
}

.modal-actions .primary:hover {
  background: #e6a500;
}

.modal-actions .secondary {
  background: #6b7280;
  color: white;
}

.modal-actions .secondary:hover {
  background: #4b5563;
}

/* 新增套餐按钮样式 */
.btn-add-setmeal {
  background: #f7b500;
  color: #1f2328;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 16px;
  transition: background-color 0.2s;
}

.btn-add-setmeal:hover {
  background: #e6a500;
}

/* 表格修改按钮样式 */
.btn-modify {
  background: #3b82f6;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.btn-modify:hover {
  background: #2563eb;
}